/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cronos.config;

import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author Leonardo Oliveira Moreira
 */
public class Configuration {
    
    public static final String DATABASE_DRIVER = getProperty("cronos.database.driver");
    public static final String DATABASE_URL = getProperty("cronos.database.url");
    public static final String DATABASE_USERNAME = getProperty("cronos.database.username");
    public static final String DATABASE_PASSWORD = getProperty("cronos.database.password");
    
    private Configuration() {
        
    }

    /**
     * 
     * @param key
     * @return 
     */
    private static final String getProperty(String key) {
        Properties properties = new Properties();
        try {
            properties.load(Configuration.class.getResourceAsStream("configuration.properties"));
            return properties.getProperty(key);
        } catch (IOException ex) {
            return null;
        }
    }
    
}